# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user              <%= @daemon_user %>;
worker_processes  <%= @worker_processes%>;

error_log  <%= @log_dir %>/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        <%= @pid_file %>;

events {
    worker_connections  <%= @worker_connections %>;
    <% if @multi_accept == 'on' -%>
    multi_accept on;
    <% end -%>
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  <%= @log_dir %>/access.log  main;

    sendfile        <%= @sendfile %>;
    tcp_nopush      <%= @tcp_nopush %>;

    keepalive_timeout  <%= @keepalive_timeout%>;
    tcp_nodelay        <%= @tcp_nodelay%>;

<% if @gzip == 'on' -%>
    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
<% end -%>

    # Load config files from the /etc/nginx/conf.d directory
    # The default server is in conf.d/default.conf
    include <%= @confd_dir.sub(/\/$/,'') %>/*.conf;

}
